<?php
	$css_list[0]['url'][] = './tpl/css/zone.css';
	$js_list[0] = './tpl/js/zone.js';
?>
<!--{template inc/header_n}-->
<!--{template inc/u/u_menu}-->
<div class="wrapper">
	<div class="zone_left">
		<ul class="zone_tab clearfix">
			<li><a href="{u u/follow uid=$home_uid}">{$_FANWE['home_user_names']['short']}的关注</a></li>
			<li><a href="{u u/fans uid=$home_uid}">{$_FANWE['home_user_names']['short']}的粉丝</a></li>
			<li class="c"><a href="{u u/coupon uid=$home_uid}">{$_FANWE['home_user_names']['short']}的优惠券</a></li>
			<li style="float:right;border:none;background:none;">{$_FANWE['user']['coupon_num']}/{$_FANWE['user']['hzl_num']}张优惠券</li>
		</ul>
		<ul class="people_list clearfix" ptype="follow">
            <!--{loop $users $user}-->
            <li class="clearfix PEOPLE_ID_BOX" id="people_id_{$follow_user['uid']}">
                <a href="{u u/index uid=$user['uid']}"><img class="avt icard GUID" uid="{$user['uid']}" src="{avatar $user['avatar'] m}" alt="{$user['user_name']}" width="48"></a>
                <div class="people_info">
                    <a class="n icard bc GUID" uid="{$user['uid']}" href="{u u/index uid=$user['uid']}">{$user['user_name']}</a><br>
                    <span>已获赠优惠券</span>
                </div>
                <div class="people_toolbar">
                    <a class="unFollow" href="/u.php?action=follow&uid={$_FANWE['uid']}">查看</a>
                </div>
            </li>
            <!--{/loop}-->
            <?php for($i = 1; $i <= $_FANWE['user']['coupon_num']; $i++) { ?>
            <li class="clearfix PEOPLE_ID_BOX" id="people_id_{$follow_user['uid']}">
                <div class="people_info">
                    <a href="/u.php?action=follow&uid={$_FANWE['uid']}" style="color:red;">未赠送优惠券{$i}</a><br/>
                    <span>尚未赠送</span>
                </div>
                <div class="people_toolbar">
                    <a class="unFollow" href="/u.php?action=follow&uid={$_FANWE['uid']}">点击赠送</a>
                </div>
            </li>
            <?php }?>
        </ul>
        <div class="pagination">
            <!--{subtemplate inc/pages}-->
        </div>
    </div>
    <!--{template inc/u/u_me_right}-->
</div>
<script type="text/javascript">
function MeUpdateUserFollow(obj,result)
{
	$(obj).parents('.PEOPLE_ID_BOX').slideUp("slow");
}

function UpdateUserFollow(obj,result)
{
	var parent = $(obj).parent();
	if(result.status == 1)
	{
		$('.follow0',parent).hide();
		$('.follow1',parent).show();
	}
	else
	{
		$('.follow0',parent.parent()).show();
		$(obj).parent().hide();
	}
	
}

function DeleteUserFans(obj,result)
{
	var parent = $(obj).parent().parent();
	if(result.status == 1)
	{
		$('.follow1',parent).hide();
		$('.follow0',parent).show();
	}
}

function coupon_give(uid) {
    $.get('/u.php?action=coupon_give&uid='+uid, function(s) {
        if(s == '1') alert('该好友已经有优惠券啦！');
        else if(s == '2') alert('优惠券赠送成功！');
        else if(s == '3') alert('您的优惠券不足！');
    });
}
</script>
<!--{template inc/footer}-->
